/**
 * 
 */
package it.unical.canonaco.rende.igpe.game.cbv.guilayer.match.components;

import javax.swing.ImageIcon;

import it.unical.canonaco.rende.igpe.game.cbv.logiclayer.engine.GUIDStorage;
import it.unical.canonaco.rende.igpe.game.cbv.logiclayer.engine.actions.AbilityAttackAction;
import it.unical.canonaco.rende.igpe.game.cbv.logiclayer.engine.actions.ActionCoordinateInfo;
import it.unical.canonaco.rende.igpe.game.cbv.logiclayer.engine.actions.ActionMediator;
import it.unical.canonaco.rende.igpe.game.cbv.logiclayer.engine.actions.ActionSpellInfo;
import it.unical.canonaco.rende.igpe.game.cbv.logiclayer.engine.actions.CharacterAttackAction;
import it.unical.canonaco.rende.igpe.game.cbv.logiclayer.engine.component.pawn.GenericPawn;

/**
 * @author Massimo Canonaco
 *
 */
 class JListAttackData
{
	int attackID;
	String displayName;
	
	AttackInformationPanel016 p;
	

	private String cost;
	
	private ImageIcon aoe;
	
	private ImageIcon friendly;
	
	private CharacterStatusPanel016 container;
	
	public JListAttackData(CharacterStatusPanel016 container)
	{
		this.container = container;
//		icon = new ImageIcon();
//		s = true;
	}
	@Override
	public String toString() 
	{
		return displayName;
	}
	
	public void action()
	{
		
//		container.getCicp().setReady(true);
		GenericPawn actualActor = container.getCicp().getActualCharacter();
////		ActionMediator mediator = container.getCicp().getMatchManagerMonitor().getCurrentPlayer().getActions();
//		ActionMediator mediator = container.getCicp().getMatchManagerMonitor().getClientPlayer().getActions();
//		mediator.setAction(CharacterAttackAction.GUID);
//		mediator.addActionInfo(new ActionCoordinateInfo(actualActor.getRow(), actualActor.getColumn()));
//		if(s)
//		{
//		System.out.println("action");
		ActionMediator mediator = container.getCicp().getMatchManagerMonitor().getCurrentPlayer().getActions();
//		GenericPawn actualActor = container.getCicp().getActualCharacter();
//		if(actualActor == null)
//			System.out.println("NO ACTOR");
		mediator.clearInformations();
		mediator.setAction(GUIDStorage.ABILITY_ATTACK_ACTION);
//		mediator.getCurrentAction().reset();
		mediator.addActionInfo(new ActionCoordinateInfo(actualActor.getRow(), actualActor.getColumn()));
		mediator.addActionInfo(new ActionSpellInfo(attackID));
		container.getCicp().setReady(true);
//		s = false;
//		}
//		System.out.println("attack id "+attackID);
	}
	
	/** */
	public void setAoEIcon(ImageIcon areaOfEffect_On) 
	{
		aoe = areaOfEffect_On;
	}
	
	/** */
	public ImageIcon getAoEIcon() 
	{
		return aoe;
	}
	/**
	 * @return the friendly
	 */
	public ImageIcon getFriendlyIcon() {
		return friendly;
	}
	/**
	 * @param friendly the friendly to set
	 */
	public void setFriendlyIcon(ImageIcon friendly) {
		this.friendly = friendly;
	}
	/**
	 * @return the cost
	 */
	public String getCost() {
		return cost;
	}
	/**
	 * @param cost the cost to set
	 */
	public void setCost(String cost) {
		this.cost = cost;
	}
	
}